Skip to content

core, params: EIP-8304 system contract plumbing - #35496

Draft
VanshSahay wants to merge 4 commits into
ethereum:masterfrom
VanshSahay:eip8304-m0
Draft

core, params: EIP-8304 system contract plumbing#35496
VanshSahay wants to merge 4 commits into
ethereum:masterfrom
VanshSahay:eip8304-m0

Conversation

@VanshSahay

Copy link
Copy Markdown

EPF cohort-seven implementation of EIP-8304 (trustless log and transaction index)

this is the first PR of an incremental series

the system call runs unconditionally like EIP-4788 style where it is a silent no-op when no code exists at the index contract address, so non-dev chains are unaffected, no fork configuration is added yet

it has -

  • params: index contract address (provisional 0x…8304, the spec's rlp([sender, 0]) derivation is still TBD, analogous to EIP-4788's post-merge address update)
  • core/genesis.go: contract pre-deployed in the dev genesis alloc
  • core: level-0 table builder (interim: fixed-size entries, flat keccak root, spec-correct encodings and SSZ roots will be in followup PRs)
  • core/state_processor.go: PostExecution writes table roots via a system call
  • miner/worker.go: the miner builds the same tables so produced blocks match the chain processor
  • replay paths (t8n, simulate, chain_makers, parallel processor) pass nil tables for now, will be wired in a later PR
  • core/logindex_contract_test.go: golden test pinning the contract behavior (deployment exactness, set slot formula table_size*1024 + (first_block/table_size)%1024, caller guard, get path with freshness boundaries and revert guards)

Validation

  • go test ./core/
  • block-processing overhead benchmark (local, not part of this PR):
    +8µs/block (0 logs) to +230µs/block (1000 logs, ~54%) versus the no-contract baseline on Apple M4, the system call plus storage write is a fixed ~8µs

follow up PRs: variable-length entries (parameterized encodings), SSZ table roots, k-way table merges, file-backed storage, replay/reorg handling, proof-index database and a RPC endpoint

@rjl493456442

Copy link
Copy Markdown
Member

@zsfelfoldi Please take a look.

@VanshSahay

Copy link
Copy Markdown
Author

bumping this up @zsfelfoldi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants